<template>
  <view class="item-container">
    <!-- 头像 -->
    <view class="img" > <image
      class="avatar"
      :src="data.avatar"
      mode="aspectFit"
    /> </view>
    <!-- 评论区 -->
    <view class="comment-txt">
      <text class="comment-author">{{ data.nickname || data.userName }}</text>
      <text class="content">{{ data.content }} </text>
      <text class="time"> {{ $filters.relativeTime(data.postTime)  }}</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"article-comment-item",
    props:{
      data:{
        type:Object,
        required:true
      }
    },
    data() {
      return {
        
      };
    }
  }
</script>

<style lang="scss" scoped>
.item-container{
  display: flex;
  padding: 15px 0;
  .comment-txt{
    display: flex;
    flex-direction: column;
    margin-left: 10px;
    .comment-author{
      font-size: 14px;
      color:  $uni-main-color;
    }
    .content{
      font-size: 12px;
      color:  $uni-base-color;
    }
    .time{
      font-size: 10px;
      color:  $uni-base-color;
    }

  }
}

</style>